package drds.binlog.protocol.protocol_proto;

/**
 * Protobuf enum {@code com.alibaba.otter.canal.protocol.Compression}
 */
public enum Compression
        implements com.google.protobuf.ProtocolMessageEnum
{
    /**
     * <code>compressioncompatibleproto2 = 0;</code>
     */
    compressioncompatibleproto2(0),
    /**
     * <code>none = 1;</code>
     */
    none(1),
    /**
     * <code>zlib = 2;</code>
     */
    zlib(2),
    /**
     * <code>gzip = 3;</code>
     */
    gzip(3),
    /**
     * <code>lzf = 4;</code>
     */
    lzf(4),
    unrecognized(-1),;

    /**
     * <code>COMPRESSIONCOMPATIBLEPROTO2 = 0;</code>
     */
    public static final int compressioncompatibleproto2_value = 0;
    /**
     * <code>NONE = 1;</code>
     */
    public static final int none_value = 1;
    /**
     * <code>ZLIB = 2;</code>
     */
    public static final int zlib_value = 2;
    /**
     * <code>GZIP = 3;</code>
     */
    public static final int gzip_value = 3;
    /**
     * <code>LZF = 4;</code>
     */
    public static final int lzf_value = 4;
    private static final com.google.protobuf.Internal.EnumLiteMap<
            Compression> internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<Compression>()
            {
                public Compression findValueByNumber(int number)
                {
                    return Compression.forNumber(number);
                }
            };
    private static final Compression[] VALUES = values();
    private final int value;

    private Compression(int value)
    {
        this.value = value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @Deprecated
    public static Compression valueOf(int value)
    {
        return forNumber(value);
    }

    public static Compression forNumber(int value)
    {
        switch (value)
        {
            case 0:
                return compressioncompatibleproto2;
            case 1:
                return none;
            case 2:
                return zlib;
            case 3:
                return gzip;
            case 4:
                return lzf;
            default:
                return null;
        }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<Compression>
    internalGetValueMap()
    {
        return internalValueMap;
    }

    public static final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptor()
    {
        return BinlogPacket.getDescriptor().getEnumTypes().get(0);
    }

    public static Compression valueOf(
            com.google.protobuf.Descriptors.EnumValueDescriptor desc)
    {
        if (desc.getType() != getDescriptor())
        {
            throw new IllegalArgumentException(
                    "EnumValueDescriptor is not for this type.");
        }
        if (desc.getIndex() == -1)
        {
            return unrecognized;
        }
        return VALUES[desc.getIndex()];
    }

    public final int getNumber()
    {
        if (this == unrecognized)
        {
            throw new IllegalArgumentException(
                    "Can't get the number of an unknown enum value.");
        }
        return value;
    }

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
    getValueDescriptor()
    {
        return getDescriptor().getValues().get(ordinal());
    }

    public final com.google.protobuf.Descriptors.EnumDescriptor
    getDescriptorForType()
    {
        return getDescriptor();
    }

    // @@protoc_insertion_point(enum_scope:com.alibaba.otter.canal.protocol.Compression)
}
